package com.fjec.common.schedule;

import com.fjec.common.Const;
import com.fjec.common.util.BizUtil;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;

@Slf4j
public class BaseScheduleHandler {

    public String error(Throwable t) {
        String guid = BizUtil.guid();
        if (t != null) {
            MDC.put(Const.TRACE_ID_KEY, guid);
            log.error(t.getMessage(), t);
            MDC.remove(Const.TRACE_ID_KEY);
        }
        return guid;
    }
}
